package cn.lili.controller.feign.member;

import cn.lili.modules.member.client.MemberStatisticsClient;
import cn.lili.modules.member.entity.dto.MemberStatisticsSearchParams;
import cn.lili.modules.member.entity.vo.MemberDistributionVO;
import cn.lili.modules.member.service.MemberStatisticsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @author paulG
 * @since 2022/6/28
 **/
@RestController
@RequiredArgsConstructor
public class MemberStatisticsFeignController implements MemberStatisticsClient {


    private final MemberStatisticsService memberStatisticsService;

    @Override
    public long getMemberCount() {
        return memberStatisticsService.getMemberCount();
    }

    @Override
    public long todayMemberNum() {
        return memberStatisticsService.todayMemberNum();
    }

    @Override
    public long memberCount(Date endTime) {
        return memberStatisticsService.memberCount(endTime);
    }

    @Override
    public long activeQuantity(Date startTime) {
        return memberStatisticsService.activeQuantity(startTime);
    }

    @Override
    public long newlyAdded(MemberStatisticsSearchParams searchParams) {
        return memberStatisticsService.newlyAdded(searchParams);
    }

    @Override
    public List<MemberDistributionVO> distribution() {
        return memberStatisticsService.distribution();
    }
}
